https://leetcode.cn/problems/target-sum/
class Solution {
public:
    int ret;
    int _t;

    void dfs(vector<int >&nums,int pos,long path)
    {
        if(nums.size()==pos)
        {
            if(path==_t)
                ret++;
            return ;
        }

        dfs(nums,pos+1,path+nums[pos]);
        dfs(nums,pos+1,path-nums[pos]);

    }


    int findTargetSumWays(vector<int>& nums, int target) {
        _t=target;
        dfs(nums,0,0);
        return ret;
    }
};